package com.cooper.entity;

import java.math.BigDecimal;

import com.cooper.constants.ResourceConstants;
import com.cooper.domain.Entity;

/**
 * 订单行
* @Description: 
* @version: v1.0.0
* @author: tianlg
* @date: Mar 8, 2015 11:26:56 AM
*
* Modification History:
* Date         Author          Version            Description
*---------------------------------------------------------*
* Mar 8, 2015      tianlg          v1.0.0
 */
public class OrderItem extends Entity {

	private static final long serialVersionUID = -7172875991108928714L;

	private String orderNum;
	private Long mealId;
	private Long itemId;
	private String itemTitle;
	private String mainUrl;
	private Long skuId;
	private String propKey;
	private String propName;
	/** 单品原价格 */
	private BigDecimal executePrice;
	/** 单品优惠价格 */
	private BigDecimal favourPrice;
	private int amount;
	private BigDecimal totalPrice;
	/** 总价优惠 */
	private BigDecimal preferential = new BigDecimal(0);
	
	/** 交易状态 */
	private String tradeStatus = ResourceConstants.TradeStatus.ORDER_CREATED;
	/** 快照ID, 如果mealId不为空，则是套餐的快照 */
	private Long snapshotId;
	
	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	public Long getMealId() {
		return mealId;
	}

	public void setMealId(Long mealId) {
		this.mealId = mealId;
	}

	public Long getItemId() {
		return itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}

	public String getItemTitle() {
		return itemTitle;
	}

	public void setItemTitle(String itemTitle) {
		this.itemTitle = itemTitle;
	}

	public String getMainUrl() {
		return mainUrl;
	}

	public void setMainUrl(String mainUrl) {
		this.mainUrl = mainUrl;
	}

	public Long getSkuId() {
		return skuId;
	}

	public void setSkuId(Long skuId) {
		this.skuId = skuId;
	}

	public String getPropKey() {
		return propKey;
	}

	public void setPropKey(String propKey) {
		this.propKey = propKey;
	}

	public String getPropName() {
		return propName;
	}

	public void setPropName(String propName) {
		this.propName = propName;
	}

	public BigDecimal getExecutePrice() {
		return executePrice;
	}

	public void setExecutePrice(BigDecimal executePrice) {
		this.executePrice = executePrice;
	}

	public BigDecimal getFavourPrice() {
		return favourPrice;
	}

	public void setFavourPrice(BigDecimal favourPrice) {
		this.favourPrice = favourPrice;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public BigDecimal getTotalPrice() {
		if(null != this.favourPrice){
			this.totalPrice = this.favourPrice.multiply(new BigDecimal(this.amount));
		}
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public BigDecimal getPreferential() {
		return preferential;
	}

	public void setPreferential(BigDecimal preferential) {
		this.preferential = preferential;
	}

	public String getTradeStatus() {
		return tradeStatus;
	}

	public void setTradeStatus(String tradeStatus) {
		this.tradeStatus = tradeStatus;
	}

	public Long getSnapshotId() {
		return snapshotId;
	}

	public void setSnapshotId(Long snapshotId) {
		this.snapshotId = snapshotId;
	}
	
}
